﻿//
// Created: 2018/12/2
// Author: chenqiang
//
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Model.WXshopBuiness;

namespace Model.WXshopBuiness.Map
{
    internal  class ShoppingCarMap:EntityTypeConfiguration< ShoppingCar >    
    {
        public ShoppingCarMap()
        {
             this.ToTable("ShoppingCar");
             this.HasKey(i => new { i.ShopCarId });
             this.Property(i => i.ShopCarId).HasColumnName("ShopCarId");                     
             this.Property(i => i.CreateTime).HasColumnName("CreateTime");                     
             this.Property(i => i.UserId).HasColumnName("UserId");                     
             this.Property(i => i.ProductId).HasColumnName("ProductId");                     
             this.Property(i => i.SinglePrice).HasColumnName("SinglePrice");                     
             this.Property(i => i.ProductNum).HasColumnName("ProductNum");                     
             this.Property(i => i.ItemState).HasColumnName("ItemState");                     
             this.Property(i => i.ProductName).HasColumnName("ProductName");                     
             this.Property(i => i.ProductImgUrl).HasColumnName("ProductImgUrl");                     
             this.Property(i => i.ProductDesc).HasColumnName("ProductDesc");                     
             this.Property(i => i.SingleOrigPrice).HasColumnName("SingleOrigPrice");                     
             this.Property(i => i.ProductSpecificationId).HasColumnName("ProductSpecificationId");                     
             this.Property(i => i.ProductSpecificationName).HasColumnName("ProductSpecificationName");                     
             this.Property(i => i.UpdateTime).HasColumnName("UpdateTime");                     
             this.Property(i => i.Remarks).HasColumnName("Remarks");
            this.Property(i => i.ProductUrl).HasColumnName("ProductUrl");
        }   
    }
    
     public static class ShoppingCarMapExtensions
    {
        public static void UserShoppingCarMap(this DbModelBuilder pModelBuilder)
        {
            pModelBuilder.Configurations.Add(new ShoppingCarMap());
        }
    }
}